<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<link href="<?php echo oh('url.framework.modules.page.themes.default').'/style.css'; ?>" rel="stylesheet" type="text/css" />
	<link rel="shortcut icon" href="<?php echo oh('url.framework.modules.page.themes.default').'/favicon.ico'; ?>" />
	<?php 
		if (oh("page")->have("html.head.title")) {
			echo '<title>'.oh("page.html.head.title").'</title>'."\n";
		} 
		echo '<style type="text/css">';
		if (oh("page.width") == "auto") {
		    if (oh("page")->have("sidebar")) {
			    echo '.leftcolumn {width:77%;float:left;}'."\n";
			    echo '.rightcolumn {width:20%;}'."\n";
			} else {
			    echo '.leftcolumn {width:auto;}'."\n";
			}				    
			echo '.header {width: auto;}'."\n";
			echo '.container {width: auto;}'."\n";
			echo '.historycontainer {width: auto;}'."\n";								
		} else {
			echo '.leftcolumn {width:'.(oh("page.width")-225).'px;}'."\n";
			echo '.rightcolumn {width:200px;}'."\n";
			echo '.header {width: '.oh("page.width").'px;}'."\n";
			echo '.container {width: '.oh("page.width").'px;}'."\n";				
			echo '.historycontainer {width: '.oh("page.width").'px;}'."\n";								
		}		
		echo'</style>';
		if (oh("page")->have("html.head")) {
			echo oh("page.html.head")."\n";
		} 
	?>
</head>

<body>
<div class="headercontainer"> 
	<div class="header">
		<?php 
			if (oh("page")->have("header.title")) { 
				echo '<h1>'.oh("page.header.title").'</h1>'."\n";
			}
			$menu = oh("page.header.menu");			
			foreach($menu as $label=>$link) {
				$link = oh("url.script").$link;
				if (oh("page")->is_active_page($link)) {
					$active = "menubuttonsactive";
				} else {
					$active = "";	
				}				
				echo '<a href="'.$link.'" class="menubuttons '.$active.'">'.$label.'</a>'."\n";				
			}
			if (oh("page")->have("header.right")) {
				echo '<span class="headerright">'.oh("page.header.right").'</span>';
			}
		?>
		<br clear="all" />
	</div>
</div>

<?php 
	if (oh("page")->have("content.history")) { 
		echo '<div class="historycontainer">'.oh("page.content.history").'</div>'."\n";
	} 
?>

<div class="container">	
	<div class="leftcolumn">
		<?php 
			if (oh("page")->have("content.title")) {
    			echo '<h2>'.oh("page.content.title").'</h2><hr />';
      		}
    		echo oh("page.content.body");     		
    	?>
  	</div>
	<?php 
		if (oh("page")->have("sidebar")) { 
	    	echo '<div class="rightcolumn">'.oh("page.sidebar").'</div>';
		}
	?>
	<br clear="all" />
</div>

</body>
</html>
